////#include "boost/archive/iterators/base64_from_binary.hpp"
////#include "boost/archive/iterators/binary_from_base64.hpp"
////#include "boost/archive/iterators/transform_width.hpp"
////
////#include <iterator>
////#include <sstream>
////#include <string>
////
////#include <boost/archive/iterators/base64_from_binary.hpp>
////#include <boost/archive/iterators/insert_linebreaks.hpp>
////#include <boost/archive/iterators/transform_width.hpp>
////#include <boost/archive/iterators/ostream_iterator.hpp>
////
////#include <boost/asio.hpp>
////
////
////
////int main()
////{
////    using namespace boost::archive::iterators;
////
////    //std::string test = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ornare ullamcorper ipsum ac gravida.";
////
////	boost::asio::streambuf request;
////	std::iostream request_stream(&request);
////
////	//request_stream << "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ornare ullamcorper ipsum ac gravida.";
////	request_stream << "hello world";	//"hola mundo";
////	request_stream.unsetf(std::ios::skipws); 
////
////	std::istream_iterator<char> eos;					// end-of-stream iterator
////	std::istream_iterator<char> iit (request_stream);   // stdin iterator
////
////
////
////
////	//for ( ; iit != eos; ++iit )
////	//{
////	//	std::cout << *iit;
////	//}
////
////
////
////    std::stringstream os;
////
////    //typedef 
////    //    insert_linebreaks<         // insert line breaks every 72 characters
////    //        base64_from_binary<    // convert binary values ot base64 characters
////    //            transform_width<   // retrieve 6 bit integers from a sequence of 8 bit bytes
////    //                std::istream_iterator<char>, 6, 8
////    //            >
////    //        > 
////    //        ,72
////    //    > 
////    //    base64_text; // compose all the above operations in to a new iterator
////
////
////    typedef 
////            base64_from_binary<    // convert binary values ot base64 characters
////                transform_width<   // retrieve 6 bit integers from a sequence of 8 bit bytes
////                    std::istream_iterator<char>, 6, 8
////                >
////            > 
////        base64_text; // compose all the above operations in to a new iterator
////
////
////   // std::copy( 
////			//	base64_text(iit), 
////			//	base64_text(eos), 
////			//	ostream_iterator<char>(os) 
////			//);
////
////
////
////	base64_text it(iit);
////	base64_text end(eos);
////
////	for ( ; it != end; ++it )
////	{
////		std::cout << *it;
////	}
////
////
////
////    std::cout << os.str();
////}
//
////--------------------------------------------------------------------------------------------------------------------------------
//
//
//
//
//#include <iterator>
//#include <sstream>
//#include <string>
//
//#include <boost/archive/iterators/ostream_iterator.hpp>
//#include <boost/archive/iterators/base64_from_binary.hpp>
//#include <boost/archive/iterators/binary_from_base64.hpp>
//#include <boost/archive/iterators/transform_width.hpp>
//
//
//#include "base64_range.hpp"
//
//
//
//
//int main()
//{
//    using namespace boost::archive::iterators;
//	using namespace boost::iterators;
//
//    std::string test = "hello world";	//"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce ornare ullamcorper ipsum ac gravida.";
//	//test.push_back(0);	//Padding
//
//	//request_stream.unsetf(std::ios::skipws); 
//
//
//    std::stringstream os;
//
//    //typedef 
//    //    insert_linebreaks<
//    //        base64_from_binary<
//    //            transform_width<
//    //                std::string::iterator, 6, 8
//    //            >
//    //        > 
//    //        ,72
//    //    > 
//    //    base64_text;
//
//
//    //typedef 
//    //        base64_from_binary<
//    //            transform_width<
//    //                std::string::iterator, 6, 8
//    //            >
//    //        > 
//    //    base64_text;
//
//    //typedef 
//    //        transform_width<
//    //            std::string::iterator, 6, 8
//    //        >
//    //    base64_text;
//
//
//    typedef std::string::iterator base64_text;
//
//    typedef base64_iterator< std::string::iterator > base64_text;
//
//
//
//   // std::copy( 
//			//	base64_text( test.begin() ),
//			//	base64_text( test.end() ), 
//			//	ostream_iterator<char>(os) 
//			//);
//
//
//	base64_text it( test.begin() );
//	base64_text end( test.end() );
//
//	for ( ; it != end; ++it )
//	{
//		//std::cout << (unsigned int)*it << std::endl;
//		std::cout << *it;
//	}
//
//
//
//    std::cout << os.str();
//}
//
//
//
//
//
//
////--------------------------------------------------------------------------------------------------------------------------------
//
//
//
//
//
//
//
//
//
////#include "boost/archive/iterators/base64_from_binary.hpp"
////#include "boost/archive/iterators/binary_from_base64.hpp"
////#include "boost/archive/iterators/transform_width.hpp"
////
////#include <string>
////#include <iostream>
////
////using namespace std;
////using namespace boost::archive::iterators;
////
//////typedef
//////	base64_from_binary<
//////		transform_width<std::string::iterator, 6, sizeof(char) * 8>
//////	> base64_t;
////
////typedef
////	base64_from_binary<
////		transform_width<std::string::iterator, 6, 8>
////	> base64_t;
////
////typedef
////	transform_width<
////		binary_from_base64<std::string::iterator>, sizeof(char) * 8, 6
////> binary_t;
////
////int main()
////{
////
////	string str = "Hello, world!";
////
////	cout << str << endl;
////
////	base64_t xxx1 (str.begin());
////	base64_t xxx2 (str.end());
////
////	string enc(base64_t(str.begin()), base64_t(str.end())); // Problem here. It works when I specify "str.end()-1" instead of "str.end()" but I 	loose last character after decoding.
////
////	cout << enc << endl;
////
////	string dec(binary_t(enc.begin()), binary_t(enc.end()));
////
////	cout << dec << endl;
////
////	return 0;
////
////} 
//
